package mmc.stats;

import java.io.Serializable;

public class Stat implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String name;
	private int minimum;
	private int maximum;
	private int baseValue;
	private int actualValue;
	
	public Stat(String name, int min, int max){
		this.setName(name);
		this.setMinimum(min);
		this.setMaximum(max);
		this.setActualValue(max);
	}

	public void affect(float per){
		this.maximum *= per;
	}
	
	public void add(int add, float mult){
		
		this.actualValue += add;
		this.actualValue *= mult;
		
		
		if(this.actualValue > maximum)
			this.actualValue = maximum;
		
		if(this.actualValue < minimum)
			this.actualValue = minimum;
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getMaximum() {
		return maximum;
	}

	public void setMaximum(int maximum) {
		this.maximum = maximum;
	}

	public int getMinimum() {
		return minimum;
	}

	public void setMinimum(int minimum) {
		this.minimum = minimum;
	}

	public int getActualValue() {
		return actualValue;
	}

	public void setActualValue(int actualValue) {
		this.actualValue = actualValue;
	}

	public int getBaseValue() {
		return baseValue;
	}

	public void setBaseValue(int baseValue) {
		this.baseValue = baseValue;
	}
	
	
}
